<template>
	<el-dialog :title="titleMap[mode]" v-model="visible" :width="950" destroy-on-close @closed="$emit('closed')">
		<el-form :model="form" :rules="rules" :disabled="mode=='show'" ref="dialogForm"
				 label-width="110px"
				 label-position="left">
			<el-main>
				<!--					<el-alert title="播放器使用来自西瓜视频的西瓜播放器xgplayer" type="success" style="margin-bottom:20px;"></el-alert>-->
				<el-row :gutter="15">
					<el-col :lg="24">
						<sc-video :src="playUrl" :options="options"></sc-video>
<!--						<el-card shadow="never" header="问诊视频">
							<sc-video :src="playUrl" :options="options"></sc-video>
						</el-card>-->
					</el-col>
				</el-row>
			</el-main>
		</el-form>
		<template #footer>
			<el-button @click="visible=false">关 闭</el-button>
		</template>
	</el-dialog>
</template>

<script>
import scVideo from '@/components/scVideo';

export default {
	components: {
		scVideo
	},
	emits: ['success', 'closed'],
	data() {
		return {
			mode: "add",
			titleMap: {
				show: '查看视频'
			},
			visible: false,
			isSaveing: false,
			//表单数据
			form: {},

			playUrl: "",//视频
			options: {
				poster: "",//封面
				pip: true
			},
		}
	},
	mounted() {
	},
	methods: {
		//显示
		open(mode = 'add') {
			this.mode = mode;
			this.visible = true;
			return this
		},
		//表单注入数据
		setData(data) {
			this.playUrl = data.video_url;
		}
	}
}
</script>

<style>
</style>
